import { axios_ as axios } from "@/main.js"; //路径你自己配你的
// const axios = context.config.globalProperties.$axios

/**
 * 根据数据字典编码获取字典对应数据
 *
 * @param params 字典编码 英文逗号隔开多个
 * 返回axios 的permis
 */
export const findDataDict = (param) => {
  return axios.get("/dataDictionArt/getDataDictionMapList", {
    params: { dataDictartCodes: param },
  });
};

/**
 *
 * @param {Array} dataDict 集合
 * @param {string} code 编码
 * @returns
 */
export const findDataDictName = (dataDict, code) => {
  return dataDict.find((v, index, arr) => v.code == code)?.name ?? "";
};
